//
//  PCcommentModel.m
//  PhotoCircle
//
//  Created by MAC_master on 15/12/21.
//  Copyright © 2015年 wujungao. All rights reserved.
//

#import "PCcommentModel.h"

@implementation PCCommentModel
-(instancetype)initWithDictionary:(NSDictionary *)dict
{
    self = [super initWithDictionary:dict];
    if (self) {
        NSDictionary *commentDic = nil;
        if (commentDic[@"comment"] != [NSNull null]) {
            commentDic = dict[@"comment"];
            
            if (commentDic[@"uuid"] != [NSNull null]) {
                _uuid = commentDic[@"uuid"];
            }
            if (commentDic[@"content"] != [NSNull null]) {
                _content = commentDic[@"content"];
            }

            if (commentDic[@"ago"] != [NSNull null]) {
                _timeStr = commentDic[@"ago"];
            }
            if (commentDic[@"like_count"] != [NSNull null]) {
                _like_count = [commentDic[@"like_count"] integerValue];
//                _like_count = 1000000;
            }
            if (commentDic[@"is_like"] != [NSNull null]) {
                _is_like = [commentDic[@"is_like"] boolValue];
            }
            
            if (commentDic[@"thumb"] != [NSNull null]) {
                _thumbImage = commentDic[@"thumb"];
            }
            
            if (commentDic[@"image"] != [NSNull null]) {
                _imageUrl = commentDic[@"image"];
            }
            
        }
        if (dict[@"user"] != [NSNull null]) {
            _commentUser = [[PCCommentUserModel alloc]initWithDictionary:dict[@"user"]];
        }
    }
    return self;
}

@end
